package com.gang.ssm.bos.system.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.gang.ssm.bos.system.bean.User;
import com.gang.ssm.bos.system.bean.UserExample;

public interface UserMapper {
	
	long countByExample(UserExample example);

    int deleteByExample(UserExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(User record);

    int insertSelective(User record);

    List<User> selectByExample(UserExample example);

    User selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") User record, @Param("example") UserExample example);

    int updateByExample(@Param("record") User record, @Param("example") UserExample example);

    int updateByPrimaryKeySelective(User record);

    int updateByPrimaryKey(User record);
	
	public User findByUsernameAndPassword(@Param("username")String username, @Param("password")String password);

	public void editPassword(@Param("password")String password, @Param("id")Integer id);

	public List<User> findByLimit(@Param("pageNo") int pageNo, @Param("pageSize") int pageSize);

	public void insertUserAndRole(@Param("id")Integer id, @Param("roleIdList")List<Integer> roleIdList);

	public User findByUsername(String username);

	List<Integer> findMenuIdsByUserId(Integer id);

	void deleteRoleIdAndUserIdByUserId(Integer id);

	User findById(Integer id);

}
